Skip to content

feat: publish GitHub PRs and GitLab MRs with optional AI drafts - #2901

Draft
DJ-Huang wants to merge 2 commits into
sourcegit-org:developfrom
DJ-Huang:codex/sourcegit-pr-mr-publishing
Draft

DJ-Huang wants to merge 2 commits into
sourcegit-org:developfrom
DJ-Huang:codex/sourcegit-pr-mr-publishing

Conversation

@DJ-Huang

Copy link
Copy Markdown

Review order

This draft builds on #2900, which adds the shared external CLI configuration and runner. Both PRs target upstream develop. For this change on its own, see the PR/MR-only diff. The branch will be rebased after the CLI PR lands.

Summary

  • Right-click a local branch and choose AI → Create PR/MR…. The dialog shows the source and target remotes, repositories, and branches. Edit the title and description directly or ask a configured CLI to draft them from the selected commits and diff.
  • Add a GitHub or GitLab access token in Preferences → PR/MR Credentials. SourceGit stores it in the system keychain and chooses the connection by the target remote's host. Both providers support hosted and self-managed instances. Git fetch and push use the repository's existing Git authentication.
  • After confirmation, SourceGit checks the reviewed refs, pushes the source branch if needed, and looks up an existing request before creating one through the provider API.

Screenshots

Captured from SourceGit in English with a fixture CLI, sample remotes, and an empty token field.

Review the destination and edit the draft

PR and MR dialog showing distinct source and target remotes, an editable draft, and the matched GitHub connection

Configure a provider credential

Access token dialog showing the GitHub provider and HTTPS server with an empty token field

Verification

  • Windows .NET 10 build and dotnet format --verify-no-changes.
  • Two local bare remotes and a controlled publisher covered a rejected push, separate source and target remotes, and recovery after an uncertain publication result.
  • Verified the GitHub cross-fork request against a loopback API and authenticated project and MR lookup against a self-managed GitLab instance. Live API creation remains untested.

Related to #980 and the browser handoff workflow in #2802.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant